home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / mg2a_src.zip / VARARGS.H < prev    next >
Text File  |  1991-02-16  |  955b  |  25 lines

  1. /* varargs.h for MicroGnuEmacs 2a.  This one will work on systems that    */
  2. /* the non-varargs version of mg 1 did.                    */
  3. /* based on the one I wrote for os9/68k .  I did not look at the bsd code. */
  4.  
  5. /* by Robert A. Larson */
  6.  
  7. /* assumptions made about how arguments are passed:            */
  8. /*    arguments are stored in a block of memory with no padding between. */
  9. /*    The first argument will have the lowest address            */
  10.  
  11. /* varargs is a "portable" way to write a routine that takes a variable */
  12. /* number of arguements.  This implemination agrees with both the 4.2bsd*/
  13. /* and Sys V documentation of varargs.  Note that just because varargs.h*/
  14. /* is used does not mean that it is used properly.            */
  15.  
  16. #define va_dcl        unsigned va_alist;
  17.  
  18. typedef    char *va_list;
  19.  
  20. #define    va_start(pvar)        ((pvar) = (char *)&va_alist)
  21.  
  22. #define va_arg(pvar,type)    (((pvar)+=sizeof(type)),*(((type *)(pvar)) - 1))
  23.  
  24. #define va_end(pvar)        /* va_end is simple */
  25.